﻿<%@ Page Title="Research List" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="ResearchList.aspx.vb" Inherits="Final.ResearchList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
 <style type="text/css">
        .style1
        {
            height: 186px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
       <div>
        <table width="920" cellspacing="30" style="border-style: groove">   
             <tr>
             <td class="style1">
             <h1 style="border-bottom-style: groove">Research List</h1>
             <br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="ResearchListDataSource" Width="846px" AllowPaging="True" 
                     AllowSorting="True">
            <Columns>
                <asp:HyperLinkField DataNavigateUrlFields="ID" 
                    DataNavigateUrlFormatString="~/ResearchListDetails.aspx?ID={0}" 
                    DataTextField="Title" HeaderText="Research Title" SortExpression="Title" >
                <ControlStyle CssClass="maintitle" />
                <ItemStyle Width="300px" HorizontalAlign="Center" VerticalAlign="Middle" 
                    CssClass="maintitle" />
                </asp:HyperLinkField>
                <asp:BoundField DataField="AddedBy" HeaderText="Researcher Name" 
                    SortExpression="AddedBy" >
                <ControlStyle CssClass="gridviewitem" />
                <ItemStyle Width="30px" HorizontalAlign="Center" VerticalAlign="Middle" 
                    CssClass="gridviewitem" />
                </asp:BoundField>
                <asp:BoundField DataField="University" HeaderText="University" 
                    SortExpression="University" > 
                <ControlStyle CssClass="gridviewitem" />
                <ItemStyle Width="150px" HorizontalAlign="Center" VerticalAlign="Middle" 
                    CssClass="gridviewitem" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Sample Picture">
                <ItemTemplate >
                <a href ='ResearchListDetails.aspx?ID=<%# Eval("ID") %>'>
                <img src ='<%# Eval("FirstPagePicture") %>' height ='100px' width ='100px' alt ='Research Sample Page' />
                </a>
                </ItemTemplate>
<ControlStyle BackColor="#669999" BorderColor="#99CCFF" BorderStyle="Groove" 
                    Height="100px" Width="100px" />
                <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <ItemStyle Width="100px" />

                </asp:TemplateField>
                <asp:TemplateField HeaderText="Available Rating" SortExpression="Rating">
                <ItemTemplate>
                <h2><%# doRating(Eval("Rating"))%></h2>
                </ItemTemplate>
                    <ControlStyle Height="10px" Width="100px" />
                    <ItemStyle Width="100px" HorizontalAlign="Center" VerticalAlign="Middle" />
                </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="#29A4EC" ForeColor="#4A3C8C" />
        <HeaderStyle BackColor="#29A4EC" Font-Bold="True" ForeColor="#F7F7F7" />
        <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
        <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
        <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
        <SortedAscendingCellStyle BackColor="#F4F4FD" />
        <SortedAscendingHeaderStyle BackColor="#5A4C9D" />
        <SortedDescendingCellStyle BackColor="#D8D8F0" />
        <SortedDescendingHeaderStyle BackColor="#3E3277" />
        </asp:GridView>
        <asp:SqlDataSource ID="ResearchListDataSource" runat="server" 
            ConnectionString="<%$ ConnectionStrings:FinalConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:FinalConnectionString.ProviderName %>" 
            
                     
                     SelectCommand="SELECT [ID], [Title], [AddedBy], [University], [FirstPagePicture], [Rating] FROM [Researches] ORDER BY ID DESC">
        </asp:SqlDataSource>
        </td> 
        </tr> 
        </table> 
        </div>

</asp:Content>
